/**
 * 
 */
package com.example.spring_cloud_feign.intf;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.example.spring_cloud_feign.intf.impl.ComputeClientHystrix;

/**
 * 使用@FeignClient("compute-service")注解来绑定该接口对应compute-service服务。<br>
 * 使用@FeignClient注解中的fallback属性指定回调类。
 */
@FeignClient(value = "compute-service", fallback = ComputeClientHystrix.class)
public interface ComputeClient {
	/**
	 * 通过Spring MVC的注解来配置compute-service服务下的具体实现。<br>
	 * <b>注意：暂时不支持Spring MVC 4.3新注解</b>
	 */
	@RequestMapping(method = RequestMethod.GET, value = "/add")
	Integer add(@RequestParam(value = "a") Integer a, @RequestParam(value = "b") Integer b);
}
